﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master1.Master" AutoEventWireup="true" CodeBehind="ProductDetail.aspx.cs"
    Inherits="TienTeTuong.ProductDetail" %>

<%@ Import Namespace="TienTeTuong" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    <div>
        <div class="mainTitle">
            <%=cateName %>
            /
            <%=cateDetail.Name %></div>
        <div class="mainBrowse">
            Trở về: <a href="Home.aspx">Trang chủ</a>&raquo;<a href="Categories.aspx">Sản phẩm</a>&raquo;<a href="CategoryDetail.aspx?CateID=<%= cateID %>"><%= cateName %></a></div>
        <div class="Content mainProduct">
            <!-- Product Detail -->
            <%if (lstProDetail.Count > 0)
              { %>
            <div class="productDetail">
                <table width="100%" cellpadding="0" cellspacing="0">
                    <tr valign="top">
                        <td class="productDetailImg">
                            <img src="<%= Common.CheckLinkPhoto(cateDetail.Image) %>" style="width: 400px; height: 300px" alt="Image" id="thumbLarge"/>
                            <div id="imgThumnals">
                                <img src="<%= Common.CheckLinkPhoto(cateDetail.Image) %>" alt="Image"/>
                                <img src="<%= Common.CheckLinkPhoto(cateDetail.Image2) %>" alt="Image"/>
                                <img src="<%= Common.CheckLinkPhoto(cateDetail.Image3) %>" alt="Image"/>
                            </div>

                        </td>
                        <td class="productDetailContent">
                            <%--      
                                    <select name="lstOption" id="lstOption" class="searchComboBox">
                                      <%if(lstOption.Count > 1){ %>
                                          <% foreach (var v in lstOption)
                                          { %>
                                              <option value="<%= v.OptionId %>"><%= v.OptionName %> </option>
                                           <% } %>
                                        <% } else {%>
                                        <option value="">Goi 1</option>
                                         <% } %>
                                    </select>--%>
                            <div id="productInfor">
                                <div class="Title">Thông tin gói hàng:</div>
                                <div style ="margin-left: 10px;">
                                    <%=cateDetail.Description %>
                                </div>
                            </div>
                            <div class="Title">
                                Bộ trọn gói:</div>
                            <div id="divLstOption">
                                <ul id="ulProName">
                                    <% foreach (var val in lstProDetail)
                                       { %>
                                    <li style="padding: 3px 0px;">
                                        <input type="checkbox" name="<%= val.ProId %>" rel="<%=val.Price %>" /><%= val.ProName %><div style ="float:right; width: 90px;"><input type="text" class="Quantitys" value="<%=val.Quantity %>" autocomplete="off" style="float:left"/><span style="float:right"><%=val.unit %></span></div></li>
                                    <% } %>
                                </ul>
                                <span id= "btnAddMore">Thêm sản phẩm</span>
                                <div class="productPrice">
                                    <span id="ProductPrice">
                                         <%= Common.DisplayAsMoney(Price.ToString())%></span> VNĐ</div>
                            </div>
                            <asp:Button CssClass="btnCartBgs" ID="btnCart" runat="server" value="Đặt hàng" Text="Đặt hàng" OnClick="btnCart_Click"></asp:Button>
                            <div class="clear" style="height: 5px;">
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
            <% } %>
            <div class="mainProductHot">
                <div class="Title">
                    Sản phẩm cùng loại</div>
                <div class="mainProductHotBgB">
                    <div class="mainProductHotBgT">
                        <%if (lstCateDetail.Count > 0)
                          { %>
                        <% foreach (var val in lstCateDetail)
                           {
                               maxPerline++; %>
                        <div class="mainProductTD">
                            <table width="100%" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td class="mainProductTDImg">
                                        <a href="productDetail.aspx?CateDetailID=<%= val.CateDetailID %>&CateID=<%= cateID %>">
                                            <img src="<%= val.Image %>" /></a>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="Title">
                                        <a href="productDetail.aspx?CateDetailID=<%= val.CateDetailID %>&CateID=<%= cateID %>">
                                            <%= val.Name%></a>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <% if (maxPerline < 3)
                           {%>
                        <div class="mainProductTDSpace">
                        </div>
                        <% } %>
                        <% if (maxPerline == 3 || lstCateDetail.Count == 1)
                           {
                               maxPerline = 0; %>
                        <div class="clear">
                        </div>
                        <% } %>
                        <% }%>
                        <% }
                          else
                          {%>
                        <center>
                            <h4>
                                Không có sản phẩm nào.</h4>
                        </center>
                        <div class="mainProductTDSpace">
                        </div>
                        <% } %>
                        <div class="clear">
                        </div>
                    </div>
                    <%--    <!--Paging-->
                            <%if (iTotalPage > 1)
                              {%>
                               <div class="clear"></div>
                                 <div class="pageNumber">
                                
                            	<a href="productDetail.aspx?CateDetailID=<%=CateDetailID %>&CateID=<%=cateID %>&page=1">&laquo; Trang đầu</a>
                                 <%for (var i = iLowerPage; i <= iUpperPage; i++)
                                {%>  
                                  <%if (i != iCurPage)
                                    {%>
                                     <a href="productDetail.aspx?CateDetailID=<%=CateDetailID %>&CateID=<%=cateID %>&page=<%=i.ToString() %>" class="Number"><%=i.ToString() %></a>
                                  <% } else{%>
                                     <a href="#" class="Current"><%=i.ToString() %></a>
                                 <% } %>
                                <% } %> 
                                <a href="productDetail.aspx?CateDetailID=<%=CateDetailID %>&CateID=<%=cateID %>&page=<%=iTotalPage %>">Trang cuối &raquo;</a>

                                <div class="clear"></div>
                               </div>
                            <% } %>
                             <!--End Paging-->
                    --%>
                </div>
            </div>
        </div>
    </div>
    <div id = "Loading"></div>
    <div id = "LoseFocus"></div>
    <div id = "ContainAjax"></div>
    <asp:HiddenField runat="server" ID="arrProductID" />
    <asp:HiddenField runat="server" ID="arrProductCount" />
    <asp:HiddenField runat="server" ID="ItemInOrderCount" />
    <script language="javascript"type="text/javascript">
        var arrProductID = $('#' + '<%=arrProductID.ClientID %>');
        var arrProductCount = $('#' + '<%=arrProductCount.ClientID %>');
        var ItemCount = $('#' + '<%=ItemInOrderCount.ClientID %>');
    </script>
    <script type="text/javascript" language="javascript" src="js/ProductDetail.js"></script>
</asp:Content>
